package com.alliky.core.binding.viewadapter.swiperefresh;

import androidx.databinding.BindingAdapter;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;

/**
 * @Description TODO
 * @Author wxianing
 * @Date 2020-11-14
 */
public class ViewAdapter {
    //下拉刷新命令
//    @BindingAdapter({"onRefreshCommand"})
//    public static void onRefreshCommand(SwipeRefreshLayout swipeRefreshLayout, final BindingCommand onRefreshCommand) {
//        swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
//            @Override
//            public void onRefresh() {
//                if (onRefreshCommand != null) {
//                    onRefreshCommand.execute();
//                }
//            }
//        });
//    }

    //是否刷新中
    @BindingAdapter({"refreshing"})
    public static void setRefreshing(SwipeRefreshLayout swipeRefreshLayout, boolean refreshing) {
        swipeRefreshLayout.setRefreshing(refreshing);
    }


}
